package com.bjgov.scoresys.entity;
// default package

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * UserProject entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "user_project", catalog = "scoresys")
public class UserProject implements java.io.Serializable {

	// Fields

	private Integer id;
	private User user;
	private Project project;
	private Float constructUnitScore;
	private Float designUnitScore;
	private Float buildUnitScore;
	private Float supervisorUnitScore;	
	private Short status;
	private Date completetime;

	// Constructors

	/** default constructor */
	public UserProject() {
	}

	/** minimal constructor */
	public UserProject(Integer id, User user, Project project) {
		this.id = id;
		this.user = user;
		this.project = project;
	}

	/** full constructor */
	public UserProject(Integer id, User user, Project project, Float constructUnitScore, Float designUnitScore,
			Float buildUnitScore, Float supervisorUnitScore, Short status,Date completetime) {
		this.id = id;
		this.user = user;
		this.project = project;
		this.constructUnitScore = constructUnitScore;
		this.designUnitScore = designUnitScore;
		this.buildUnitScore = buildUnitScore;
		this.supervisorUnitScore = supervisorUnitScore;		
		this.status = status;
		this.completetime = completetime;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROJECT_ID", nullable = false)
	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}
	
	@Column(name = "[CONSTRUCT_UNIT_SCORE]", precision = 12, scale = 0)
	public Float getConstructUnitScore() {
		return this.constructUnitScore;
	}

	public void setConstructUnitScore(Float constructUnitScore) {
		this.constructUnitScore = constructUnitScore;
	}

	@Column(name = "[DESIGN_UNIT_SCORE]", precision = 12, scale = 0)
	public Float getDesignUnitScore() {
		return this.designUnitScore;
	}

	public void setDesignUnitScore(Float designUnitScore) {
		this.designUnitScore = designUnitScore;
	}

	@Column(name = "[BUILD_UNIT_SCORE]", precision = 12, scale = 0)
	public Float getBuildUnitScore() {
		return this.buildUnitScore;
	}

	public void setBuildUnitScore(Float buildUnitScore) {
		this.buildUnitScore = buildUnitScore;
	}

	@Column(name = "[SUPERVISOR_UNIT_SCORE]", precision = 12, scale = 0)
	public Float getSupervisorUnitScore() {
		return this.supervisorUnitScore;
	}

	public void setSupervisorUnitScore(Float supervisorUnitScore) {
		this.supervisorUnitScore = supervisorUnitScore;
	}	

	@Column(name = "STATUS")
	public Short getStatus() {
		return this.status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}

	@Column(name = "CompleteTime")
	public Date getCompletetime() {
		return completetime;
	}

	public void setCompletetime(Date completetime) {
		this.completetime = completetime;
	}
	
	

}